#include <jni.h>
#include <com_example_firstndk_MainActivity.h>
#include <string.h>

#include <stdio.h>

JNIEXPORT jint JNICALL
Java_com_example_firstndk_MainActivity_plus( JNIEnv* env,
                                                  jobject thiz,
                                                  jint x,
                                                  jint y )
{
    return x + y;
}


JNIEXPORT jstring JNICALL
Java_com_example_firstndk_MainActivity_getTxtContent
  (JNIEnv *env, jobject)
{
	FILE *fd;
	char str[100];

	  fd = fopen("/sdcard/file.txt", "r");
	  fgets(str, 100, fd);
	  jstring jstrBuf = env->NewStringUTF(str);
	  fclose(fd);
	  return jstrBuf;
}
